import unittest

from Autotests.BaseTest import BaseManservSOAPTestCase
from Autotests.Suites.StressTest.Infrastructure.CreatePartnersTree import PartnersTree
from Autotests.Suites.StressTest.Operations.LocationOperations import LocationOperations
from Autotests.Suites.StressTest.Operations.PartnerOperations import PartnerOperations
from Autotests.Suites.StressTest.Operations.StorageOperations import StorageOperations
from Autotests.Suites.StressTest.Operations.StorageNodeOperations import StorageNodeOperations


class ScenarioRunner(BaseManservSOAPTestCase):
    def __init__(self, *args, **kwargs):
        BaseManservSOAPTestCase.__init__(self, *args, **kwargs)

    def setUp(self, *args, **kwargs):
        BaseManservSOAPTestCase.setUp(self, *args, **kwargs)

    def test_CreateInfrastructure(self):
        for locationId in range(0, LocationOperations()._locationsCount):
            LocationOperations()._createLocation(self.manserv, locationId)

        for storageId in range(0, StorageOperations()._storagesCount):
           StorageOperations()._createStorage(self.manserv, storageId)

        PartnersTree()._addPartnersTree(self.manserv, PartnerOperations()._parentId)

if __name__ == "__main__":
    unittest.main()
